package com.lovo.service.impl;

import com.lovo.dao.IStudentDAO;
import com.lovo.model.StudentDO;
import com.lovo.service.IStudentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Description:
 *
 * @author LiuChengQi
 * @date Created on 2020/11/17
 */
@Service
@Transactional
public class StudentService implements IStudentService {
    @Resource
    private IStudentDAO dao;
    @Override
    public Integer saveStudent(StudentDO studentDO) {
        Integer integer = dao.saveStudent(studentDO);
//        System.out.println(1/0);
        return integer;
    }

    @Override
    public Integer removeStudentById(Long id) {
        return dao.removeStudentById(id);
    }

    @Override
    public Integer updateStudent(StudentDO studentDO) {
        return dao.updateStudent(studentDO);
    }

    @Override
    public List<StudentDO> listStudentAll() {
        return dao.listStudentAll();
    }

    @Override
    public StudentDO getStudentById(Long id) {
        return dao.getStudentById(id);
    }
}
